import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import SingIn from '@/views/SignIn'
import Home from '@/views/Home'
import Layout from '@/views/Layout'
import Msg from '@/views/Msg'
import ProFile from '@/views/ProFile'
import Find from '@/views/Find'
import City from '@/views/Find/City'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/layout',
    component: Layout,
    redirect: '/layout/home',
    children: [
      {
        path: 'profile',
        component: ProFile
      },
      {
        path: 'find',
        component: Find
      },
      {
        path: 'msg',
        component: Msg
      },
      {
        path: 'home',
        component: Home
      }
    ]
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/signin',
    component: SingIn
  },
  {
    path: '/city',
    component: City
  }
]

const router = new VueRouter({
  routes
})

export default router
